package cool.houge.pig.service.auth;

import cool.houge.pig.model.AuthClient;
import reactor.core.publisher.Mono;

/**
 * 用户认证共享服务接口.
 *
 * @author KK (kzou227@qq.com)
 */
public interface SharedAuthService {

  /**
   * @param clientId
   * @return
   */
  Mono<AuthClient> findAuthClient(String clientId);

  /**
   * @param clientId
   * @param clientSecret
   * @param grantType
   * @return
   */
  Mono<AuthClient> obtainAuthClient(String clientId, String clientSecret, String grantType);

  /**
   * @param uid
   * @return
   */
  Mono<String> makeAccessToken(long uid, String clientId, String scope);

  /**
   * @param accessToken
   * @return
   */
  Mono<AccessTokenDetails> parseAccessToken(String accessToken);
}
